<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用 .property 访问属性</title>
</head>

<body>
    <h1>JSON 对象</h1>
    <p>使用点号表示法访问 JSON 对象：</p>
    <p id="demo"></p>
    <script>
        var myObj, x;
        myObj = { "name": "Bill Gates", "age": 62, "car": null };
        x = myObj.name;
        document.getElementById("demo").innerHTML = x;
    </script>
</body>

</html>